{extend name="common/userbase"} 
{block name="title"}
<title>我的收藏</title>
{/block}
{block name="content"}
<!--用户中心(收藏)-->"
<div class="user_style clearfix" id="user">
    <div class="user_title"><em></em>用户中心</div>
      <div class="clearfix user" >
      <!--左侧菜单栏样式-->
      <div class="user_left">
          <div class="user_info">
           <div class="Head_portrait"><img src="__STATICS__/images/people.png"  width="80px" height="80px"/><!--头像区域--></div>
           <div class="user_name">{:session('nickname')}<a href="#">[个人资料]</a></div>
          </div>
          <ul class="Section">
           <li><a href="{:url('user/center')}"><em></em><span>我的特色馆</span></a></li>
           <li><a href="{:url('user/info')}"><em></em><span>完善个人信息</span></a></li>
           <li><a href="{:url('user/password')}"><em></em><span>修改密码</span></a></li>
           <li><a href="{:url('user/orders')}"><em></em><span>我的订单</span></a></li>
           <li><a href="{:url('user/message')}"><em></em><span>我的评论</span></a></li>
           <li><a href="{:url('user/integral')}"><em></em><span>我的积分</span></a></li>
           <li><a href="{:url('user/collect')}"><em></em><span>我的收藏</span></a></li>
           <li><a href="{:url('user/address')}"><em></em><span>收货地址管理</span></a></li>
          </ul>
        </div>
         <!--右侧内容样式-->
       <div class=" right_style r_user_style user_right">
        <div class="user_Borders clearfix">
        <div class="title_name">
            <span class="name">用户收藏</span>
           </div>
       <!--收藏样式-->
        <div class="Collect">
          <ul class="Collect_list">
            {foreach name="collect" id="val"}
           <li>
           <div class="Collect_pro_name">
             <a href="javascript:;" class="delete_Collect" onclick="delcollect(this)"></a>
             <input type="hidden" name="shop_id" value="{$val.id}">
            <p class="img center"><a href="#"><img src="__UPLOADS__/{$val.img}" /></a></p>
            <p><a href="#" class="shopname">{$val.shopname}</a></p>
            <p class="Collect_Standard">礼盒装</p>
            <p class="Collect_price">￥{$val.discount}</p>
            </div>
           </li>
          {/foreach}
          </ul>
          <!--分页-->
          <div class="pages_Collect clearfix">
           <a href="#" class="on">《</a>
           <a href="#">1</a>
           <a href="#">2</a>
           <a href="#">3</a>
           <a href="#">4</a>
           <a href="#">》</a>
          </div>
        </div>
        </div>
       </div>
      </div>
     </div>
{/block}
{block name="footer_js"}
<script>
  $('.shopname').each(function(i){
    var name = $('.shopname').eq(i).text();
    name = name.substring(0,20);
    $('.shopname').eq(i).html(name+'...');
  })
  function delcollect(a)
  {
    var shop_id = a.parentNode.getElementsByTagName('input')[0];
			shop_id = shop_id.value;
			$.ajax({
				'url':'{:url("delcollect")}',
				'data':'shop_id='+shop_id,
				success:function(res){
					alert(res);
          window.location.href='{:url("collect")}';
				}
			})
  }
</script>
{/block}